
s="abcevaefegsgdghfdefavbdr"

string=dict()
#total=[]
#letter=[]


for i in set(s):
    t=s.count(i)
    string[i]=t
    #total.append(t)
    #letter.append(i)
    print('"{0}" ：{1}'.format(i,t))


#print("the kind of string is :",len(string))


#string1=sorted(string.items(),key= lambda string:string[0],reverse=False)
#print(string1)

string2=sorted(string.items(),key= lambda string:string[1],reverse=True)

print(string2)



top3=string2[:3]

for j in range(len(top3)):
    print('"{0}" ：{1}'.format(top3[j][0],top3[j][1]))
    


# 字典的get 方法试试